#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+1000;
typedef long long LL;
typedef long long ll;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
struct P{
ll x,y;
}s[3000];
map<pair<ll,pair<double,double> > ,ll>cnt;
int main(void){
    ll n;n=read();
    for(int i=1;i<=n;i++){
      s[i].x=read();
      s[i].y=read();
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            if(s[i].y==s[j].y){
                ll len=(s[i].x-s[j].x)*(s[i].x-s[j].x)+(s[j].y-s[i].y)*(s[j].y-s[i].y);
                double xx=(s[i].x+s[j].x)*1.0/2;
                double yy=(s[i].y+s[j].y)*1.0/2;
                ans+=cnt[{len,{xx,xx}}];
                cnt[{len,{xx,xx}}]++;
            }
        }
    }
    printf("%lld",ans);
   	return 0;
}
